Closed (fixed)
Project:
Menuwriter
Version:
6.x-6.x-dev
Component:
Code
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2009 at 13:24 UTC
Updated:
11 Oct 2009 at 04:57 UTC
I'm new to drupal and not sure if this is done "the drupal way" but i needed a collapsible version of the menuwriter block... So i added this:
function menuwriter_block_tree_output($tree, $level=1) {
$output = '<ul id="menuwriter_block">';
$items = array();
// Pull out just the menu items we are going to render so that we
// get an accurate count for the first/last classes.
foreach ($tree as $data) {
if (!$data['link']['hidden']) {
$items[] = $data;
}
}
$num_items = count($items);
foreach ($items as $i => $data) {
$extra_class = NULL;
if ($i == 0) {
$extra_class = 'first';
}
if ($i == $num_items - 1) {
$extra_class = 'last';
}
$link = theme_menuwriter_block_item_link( $data['link'], $level);
if ($data['below']) {
$output .= theme('menu_item', $link, $data['link']['has_children'], menuwriter_block_tree_output($data['below'], '2'), $data['link']['in_active_trail'], $extra_class);
}
else {
$output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class);
}
}
$output .= '</ul>';
return $output ;
}
How can i do changes like this without loosing the possibility to update?
regards Volkan
Comments
Comment #1
muschpusch commentedI'm stupid... That was the originial code...
This is the modified version:
Comment #2
behindthepage commentedHi Volkan,
All the features of Menuwriter have been merged into Signwriter now (or a version soon to be released) so menuwriter will not be upgraded or improved (so hack away).
You may also be interested in Cufon which is a Javascript image for text replacement with the rendering done in the browser. Check out "Cufon" on Google. There is a cufon module and adt_basetheme has cufon incorporated in it as well.
Regards
Geoff
Comment #3
behindthepage commented